package com.example.woke;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.app.Activity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.zhongcai.online.R;

public class CheckpswActivity extends Activity implements OnClickListener {

	private TextView mTget0,mTget1,mTget2,mTget3,mTget4,mTget5,mTget6,mTget7;
	private TextView mTget8,mTget9,mTjian;
	private TextView mTset1,mTset2,mTset3,mTset4,mTset5,mTset6;
	//6������
	private String psw1 = "";
	private String psw2 = "";
	private String psw3 = "";
	private String psw4 = "";
	private String psw5 = "";
	private String psw6 = "";
	
	private String psw_all = "";
	
	private Handler handler=new Handler(){  
        public void handleMessage(Message msg){
        	String r_1 = mTset1.getText().toString().trim();
        	String r_2 = mTset2.getText().toString().trim();
        	String r_3 = mTset3.getText().toString().trim();
        	String r_4 = mTset4.getText().toString().trim();
        	String r_5 = mTset5.getText().toString().trim();
        	String r_6 = mTset5.getText().toString().trim();
        	
        	if(r_1.equals("")){
        		
        	}
        	
        	
            switch (msg.arg1) { 
            case 0:  
            	
                break;
                
            case 1:  
            	
                break; 
                
            case 2:  
            	
            	break;
            	
            case 3:  
            	
            	break;
            	
            case 4:  
 	
            	break;
 	
            case 5:  
 	
            	break;
 	
            case 6:  
 	
            	break;
 	
            case 7:  
 	
            	break;
            	
            case 8:  
 	
            	break;
            	
            case 9:  
             	
            	break;
            	
            case 10:  
             	
            	break;
 	
            default:  
                break;  
            }  
        }  
    };
	private ProgressBar mBar;
    
    private void check6psw(String str){
    	psw_all = psw1 + psw2 +psw3+psw4+psw5+psw6;
//    	if(psw_all.equals("")){
    		psw_all = psw_all+str;
    		if(psw_all.length() == 6){
    			mBar.setVisibility(View.VISIBLE);
    		}
//    	}
    }
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout_paypsw_zdy);
		
		intview();
		
	}

	private void intview() {
		
		
		
		findViewById(R.id.psw_back).setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				finish();
			}
		});
		
		mBar = (ProgressBar) findViewById(R.id.psw_bar);
		
		mTget0 = (TextView) findViewById(R.id.psw_0);
		mTget1 = (TextView) findViewById(R.id.psw_1);
		mTget2 = (TextView) findViewById(R.id.psw_2);
		mTget3 = (TextView) findViewById(R.id.psw_3);
		mTget4 = (TextView) findViewById(R.id.psw_4);
		mTget5 = (TextView) findViewById(R.id.psw_5);
		mTget6 = (TextView) findViewById(R.id.psw_6);
		mTget7 = (TextView) findViewById(R.id.psw_7);
		mTget8 = (TextView) findViewById(R.id.psw_8);
		mTget9 = (TextView) findViewById(R.id.psw_9);
		mTjian = (TextView) findViewById(R.id.psw_jian);
		
		mTset1 = (TextView) findViewById(R.id.psw_p1);
		mTset2 = (TextView) findViewById(R.id.psw_p2);
		mTset3 = (TextView) findViewById(R.id.psw_p3);
		mTset4 = (TextView) findViewById(R.id.psw_p4);
		mTset5 = (TextView) findViewById(R.id.psw_p5);
		mTset6 = (TextView) findViewById(R.id.psw_p6);
		
		mTget0.setOnClickListener(this);
		mTget1.setOnClickListener(this);
		mTget2.setOnClickListener(this);
		mTget3.setOnClickListener(this);
		mTget4.setOnClickListener(this);
		mTget5.setOnClickListener(this);
		mTget6.setOnClickListener(this);
		mTget7.setOnClickListener(this);
		mTget8.setOnClickListener(this);
		mTget9.setOnClickListener(this);
		mTjian.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		Message msgMessage=new Message();  
		switch (v.getId()) {
		case R.id.psw_0:
	         msgMessage.arg1=0;  
	         handler.sendMessage(msgMessage); 
			break;
			
		case R.id.psw_1:
	         msgMessage.arg1=1;  
	         handler.sendMessage(msgMessage); 
			break;
			
		case R.id.psw_2:
	         msgMessage.arg1=2;  
	         handler.sendMessage(msgMessage); 
			break;
			
		case R.id.psw_3:
	         msgMessage.arg1=3;  
	         handler.sendMessage(msgMessage); 
			break;
		case R.id.psw_4:
	         msgMessage.arg1=4;  
	         handler.sendMessage(msgMessage); 
			break;
		case R.id.psw_5:
	         msgMessage.arg1=5;  
	         handler.sendMessage(msgMessage); 
			break;
		case R.id.psw_6:
	         msgMessage.arg1=6;  
	         handler.sendMessage(msgMessage); 
			break;
		case R.id.psw_7:
	         msgMessage.arg1=7;  
	         handler.sendMessage(msgMessage); 
			break;
		case R.id.psw_8:
	         msgMessage.arg1=8;  
	         handler.sendMessage(msgMessage); 
			break;
			
		case R.id.psw_9:
	         msgMessage.arg1=9;  
	         handler.sendMessage(msgMessage); 
			break;
			
		case R.id.psw_jian:
	         msgMessage.arg1=10;  
	         handler.sendMessage(msgMessage); 
			break;
			

		default:
			break;
		}
	}
}
